# -*- coding: utf-8 -*-


from django.db import models
import urllib2, urlparse

#######################################################################
####################  Enumeration  ####################################
LOCATION = (
		(0, u'서울시'),
		(1, u'부산시'),
		(2, u'인천시'),
		(3, u'대전시'),
		(4, u'광주시'),
		(5, u'대구시'),
		(6, u'제주시'),
		(7, u'경기도'),
		(8, u'강원도'),
		(9, u'충청북도'),
		(10, u'충청남도'),
		(11, u'전라북도'),
		(12, u'전라남도'),
		(13, u'경상북도'),
		(14, u'경상남도'),

	)
SEX = (
		(0, u'Male'),
		(1, u'Female'),
	)

#######################################################################
####################  Member ##########################################

# << control >>

#class Membership(models.Manager):
#	def __init__(self):
#		super(Membership, self).__init__()
#		self.length = 0
#		self.members = list()
#	def create(self


# << entity >>

class Member(models.Model):
	#주소값 수정
	photo = models.ImageField(upload_to='/MemberPhoto/', default='default.jpg')
	id = models.SlugField(max_length = 15 , primary_key=True)
	password = models.CharField(max_length= 15)
	name = models.CharField(max_length = 20)
	e_mail = models.EmailField(max_length = 75)

	introduction = models.TextField(blank = True)
	location = models.PositiveSmallIntegerField(null=True, choices=LOCATION)
	sex = models.PositiveSmallIntegerField(null=True, choices=SEX)
	private_protect = models.NullBooleanField()

	pub_date = models.DateTimeField('date published')

	def __unicode__(self):
		return self.id


	
	
